﻿Imports System

Imports Microsoft.VisualBasic

Imports Microsoft.VisualStudio.TestTools.UnitTesting

Imports TorneosBackEnd



'''<summary>
'''This is a test class for ParticipanteNegocioTest and is intended
'''to contain all ParticipanteNegocioTest Unit Tests
'''</summary>
<TestClass()> _
Public Class ParticipanteNegocioTest


    Private testContextInstance As TestContext

    '''<summary>
    '''Gets or sets the test context which provides
    '''information about and functionality for the current test run.
    '''</summary>
    Public Property TestContext() As TestContext
        Get
            Return testContextInstance
        End Get
        Set(value As TestContext)
            testContextInstance = Value
        End Set
    End Property

#Region "Additional test attributes"
    '
    'You can use the following additional attributes as you write your tests:
    '
    'Use ClassInitialize to run code before running the first test in the class
    '<ClassInitialize()>  _
    'Public Shared Sub MyClassInitialize(ByVal testContext As TestContext)
    'End Sub
    '
    'Use ClassCleanup to run code after all tests in a class have run
    '<ClassCleanup()>  _
    'Public Shared Sub MyClassCleanup()
    'End Sub
    '
    'Use TestInitialize to run code before running each test
    '<TestInitialize()>  _
    'Public Sub MyTestInitialize()
    'End Sub
    '
    'Use TestCleanup to run code after each test has run
    '<TestCleanup()>  _
    'Public Sub MyTestCleanup()
    'End Sub
    '
#End Region


   
    '<TestMethod()> _
    Public Sub listarTest()

        Dim negocio As New ParticipanteNegocio()
        Dim todos = negocio.listar()
        Assert.AreEqual(5, todos.Count)

    End Sub

    <TestMethod()> _
    Public Sub insertarTest()
        Dim negocio As New ParticipanteNegocio()
        Try

            Dim modelo = negocio.insertar("Lucero", "Espinoza", "06-06-86", "F", "lucero@hotmail.com", "San Luis")

            Console.Write(modelo.idParticipante)

        Catch ex As DAOExcepcion

            Assert.Fail(ex.ToString())

        End Try
    End Sub

    '''<summary>
    '''A test for actualizar
    '''</summary>
    <TestMethod()> _
    Public Sub actualizarTest()

        Dim negocio As New ParticipanteNegocio()

        Try
            negocio.actualizar(2, "Javier", "Mamacuevo", "05-11-92", "M", "abdel@123.com", "Lima")


        Catch ex As Exception
            Assert.Fail(ex.ToString())
        End Try


    End Sub
End Class
